﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Business.Logic;
using Business.Entities;
using Data.Database;

namespace Business.Logic
{
    public class PlanesLogic
    {
        private PlanesAdapter PlanesData;

        public PlanesLogic()
        {
            PlanesData = new PlanesAdapter();
        }

        public List<Plan> GetAll()//correcto
        {
            try
            {
                return PlanesData.GetAll();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public Plan GetOne(int ID) //correcto
        {
            try
            {
                Console.WriteLine();
                return PlanesData.GetOne(ID); //llama al metodo, para traer un Materia espeicifica desde data
            }
            catch (Exception ex)
            {
                throw ex;
            }

        }

        public void Delete(Plan pl) //correcto
        {
            try
            {
                PlanesData.Delete(pl); //llama al metodo, para eliminar un Materias espercifica en data
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public void Save(Plan pl) //correcto
        {
            try
            {
                PlanesData.Save(pl); //llama al metodo, para guardar un Materias espercifico en data
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

    }
}
